
# ifndef __DFX_FILE_H__
# define __DFX_FILE_H__

# include "dfxCore.h"

namespace DFX
{
    class DFX_EXPORT FileBase
    {
    protected:

        String mFileName;
        
    public:

        FileBase()
        {
        }

        virtual ~FileBase()
        {
        }

        const String& GetFileName() const
        {
            return mFileName;
        }

        virtual const UInt8* GetData() const = 0;
        virtual UInt64 GetSize() const = 0;
    };

    class DFX_EXPORT File : public FileBase
    {
    protected:

        UInt8       *mData;
        UInt64      mSize;

    public:

        File()
            : mData(NULL), mSize(0)
        {
        }

        virtual ~File()
        {
        }

        const UInt8* GetData() const
        {
            return mData;
        }

        UInt64 GetSize() const
        {
            return mSize;
        }

        virtual DFXRESULT Open(const String &fileName) = 0;
        virtual DFXRESULT Close() = 0;
    };
}

# endif